package com.swagger.controller;

import com.swagger.pojo.FinanceSchemeCheckDTO;
import com.swagger.pojo.SkipCheckDTO;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.Parameter;
import io.swagger.v3.oas.annotations.Parameters;
import io.swagger.v3.oas.annotations.tags.Tag;
import org.springframework.web.bind.annotation.*;

import javax.validation.Valid;


/**
 * 计划控制类
 *
 * @author Amadeus
 * @date 2023/09/12
 */
@Tag(name = "PlanController", description = "计划控制类")
@RestController
@RequestMapping("/admin/v1/")
public class PlanController {

    @Operation(summary = "订单详情跳转校验", description = "订单详情跳转校验 跳转类型：0-不展示 1-跳转试算器 2-跳转已保存的试算结果 3-跳转我的金融方案")
    @PostMapping(value = "/skip/check")
    public SkipCheckDTO checkSkipStatus(@RequestBody @Valid FinanceSchemeCheckDTO financeSchemeCheckDTO) {
        SkipCheckDTO skipCheckDTO = new SkipCheckDTO();
        skipCheckDTO.setSkipType(1);
        skipCheckDTO.setStatus(1);
        skipCheckDTO.setFinanceOrderNo("doc123456789");
        return skipCheckDTO;
    }

    @Operation(summary = "查询金融方案支持的上牌城市", description = "交付助手-查询金融方案支持的上牌城市")
    @Parameters({
            @Parameter(name = "orderId", description = "整车订单号", required = true),
            @Parameter(name = "financeOrderNo", description = "金融订单号", required = true)
    })
    @GetMapping(value = "/getRegistrationCities")
    public String supportedRegistrationCities(
            @RequestParam(value = "orderId") String orderId,
            @RequestParam(value = "financeOrderNo") String financeOrderNo
    ) {
        return orderId;
    }
}

